package top.codedance.iotp.converter.service.master;

import top.codedance.iotp.converter.bean.MasterConnectParam;
import top.codedance.iotp.converter.service.slave.Slave;

public abstract class AdapterModbusMaster extends AbstractMaster {

    public AdapterModbusMaster(MasterConnectParam mcp) {
        super(mcp);
    }

    @Override
    public abstract void init();

    @Override
    public abstract void connect();

    @Override
    public abstract boolean isOpen();

    @Override
    public abstract void destory();

    @Override
    public void send(Slave slave, byte[] data){}

    @Override
    public byte[] request(byte[] data){
        return null;
    }

    @Override
    public void recover(byte[] data){}

    @Override
    public abstract int readHoldingRegister(int offset);

    @Override
    public abstract int[] readHoldingRegisterRange(int offset, int quantity);

    @Override
    public abstract void writeHoldingRegister(int offset, int value);

    @Override
    public abstract void writeHoldingRegisterRange(int offset, int[] range);

    @Override
    public abstract boolean[] readCoilRange(int offset, int quantity);

    @Override
    public abstract void writeCoil(int offset, boolean value);

    @Override
    public abstract void writeCoilRange(int offset, boolean[] range);

    @Override
    public abstract byte[] request(int offset, int quantity);
}
